﻿CREATE TABLE [dbo].[GroupMembers] (
    [GroupMemberID]  INT            IDENTITY (1, 1) NOT NULL,
    [UserID]         NVARCHAR (MAX) NULL,
    [GroupID]        INT            NOT NULL,
    [InviteSent]     DATETIME       DEFAULT ('1900-01-01T00:00:00.000') NOT NULL,
    [InviteAccepted] DATETIME       DEFAULT ('1900-01-01T00:00:00.000') NOT NULL,
    CONSTRAINT [PK_dbo.GroupMembers] PRIMARY KEY CLUSTERED ([GroupMemberID] ASC),
    CONSTRAINT [FK_dbo.GroupMembers_dbo.Groups_GroupID] FOREIGN KEY ([GroupID]) REFERENCES [dbo].[Groups] ([GroupID])
);


GO
CREATE NONCLUSTERED INDEX [IX_GroupID]
    ON [dbo].[GroupMembers]([GroupID] ASC);

